<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="../taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>新增报销申请</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="../css/four.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="../css/jqe/themes/default/easyui.css"/>
	<link rel="stylesheet" type="text/css" href="../css/jqe/themes/icon.css"/>

    <script type="text/javascript" src="../js/jquery-3.1.1.min.js"></script>
	<script type="text/javascript" src="../js/jquery.easyui.min.js"></script>

    <script type="text/javascript">
 
        $(function(){
         	//初始化对话框
        	 $('#dw,#dwEdit').window({
       		   onBeforeClose:function(){ 
       			   //取消时关闭等待框
       			   setTimeout(function(){ 
       				   sending.style.visibility = "hidden";
					   }, 250);
       	    }});
       	
        	   $(".btnAll").each(function(i,v){
             	   //变手型
             	     $(v).mouseover(function() {
         				$(this).css("cursor", "hand");
         			 }).mouseout(function() {
         				$(this).css("cursor", "pointer");
         			 });
             	   
              	   if($(v).html()=='【新增】'){
              		   $(v).click(function(){  
              			   $('#dw').window("open");
              		   });
              	   }else if($(v).html()=='【编辑】'){
            		   $(v).click(function(){
            			   location.href="toUpdtSal.do?sid="+$(v).prop("lang");  
            		   });
            	   }else if($(v).html()=='【删除】'){
            		   $(v).click(function(){
             			  if(confirm("确认删除'"+$(v).prop("title")+"'?")){
             				  location.href="delSal.do?sid="+$(v).prop("lang"); 
             			  }
             		   });
             	   }
                });
        	   
        	   $(".ipt").each(function(i,v){
        		   //全部
        		    $(v).keyup(function(){
        		    	   var regex = new RegExp($(v).prop("title"));   //正则
        		    	   if($(v).prop("name")=="meritCount" || $(v).prop("name")=="meritsal"){
                				   var regex = new RegExp($(v).prop("title"));   //正则
                				   $("#"+$(v).prop("id").replace(regex,"S1_")).val($("#"+$(v).prop("id").replace(regex,"B")).val()*1*$(v).val()+"");
                		    } 
        				    $("#"+$(v).prop("id").replace(regex,"S2_")).val($("#"+$(v).prop("id").replace(regex,"A")).val()*1
        						                                          +$("#"+$(v).prop("id").replace(regex,"S1_")).val()*1
        						                                          +$("#"+$(v).prop("id").replace(regex,"D")).val()*1
        						                                          +$("#"+$(v).prop("id").replace(regex,"E")).val()*1); 
        						                                          
        						                                          
        		    	/* alert($("#"+$(v).prop("id").replace(regex,"A")).val()*1);
        				alert($("#"+$(v).prop("id").replace(regex,"S1")).val()*1);
        				alert($("#"+$(v).prop("id").replace(regex,"D")).val()*1);
        				alert($("#"+$(v).prop("id").replace(regex,"E")).val()*1); */
        			})
        		 });   
        	   });
        	   
 
    </script>
</head>
<body>
	<!-- 包含等待框 -->
	<jsp:include page="../waittable.jsp" flush="true" />
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr valign="top">
			<td bgcolor="#FFFFFF"><table width="96%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#aec3de">
					<tr align="left" bgcolor="#F2FDFF">
						<td colspan="10" class="optiontitle">
						 <select name="slkt_dps">
						       <option    value="0">全部</option>
						    <c:forEach items="${dpts}" var="dpt">
						       <option ${dpt.depID==lgnUsr.ejob.depID?"selected='selected'":""} value="${dpt.depID}">${dpt.depname}</option>
						    </c:forEach>
						 </select>
						</td>
					</tr>
				  	<tr align="center">
						<td align="center" bgcolor="#ebf0f7">员工姓名</td>
						<td align="center" bgcolor="#ebf0f7">基本工资</td>
						<td align="center" bgcolor="#ebf0f7">绩效单位</td>
						<td align="center" bgcolor="#ebf0f7">绩效数量</td>
						<td align="center" bgcolor="#ebf0f7">绩效工资</td>
						<td align="center" bgcolor="#ebf0f7">补发工资</td>
						<td align="center" bgcolor="#ebf0f7">额外奖金</td>
						<td align="center" bgcolor="#ebf0f7">总额</td>
					    <td align="center" bgcolor="#ebf0f7">备注</td>
					</tr>
					<c:forEach items="${Salaries}" var="empSal">
						<tr align="center" bgcolor="#FFFFFF">
						    <td align="center">${empSal.ename}</td>
							<td align="center"> <input class="ipt" id="A${empSal.eid}" title="A" size="7" name="basicsalary" value="${empSal.basicsalary}" /></td>
							<td align="center"> <input class="ipt" id="B${empSal.eid}"  title="B"  size="4" name="meritsal" value="${empSal.meritsal}" /></td>
							<td align="center"> <input class="ipt" id="C${empSal.eid}"  title="C"  size="3" name="meritCount"  value="0"/></td>
							<td align="center">  <input size="5"   id="S1_${empSal.eid}"  title="S1"  value="0" /></td>
							<td align="center"> <input class="ipt" id="D${empSal.eid}"  title="D"  size="8" name="addsal" value="${empSal.addsal}" /></td>
							<td align="center"> <input class="ipt" id="E${empSal.eid}"  title="E"   size="8"   name="addmeritsal" value="0" /></td>
							<td align="center"> <input size="8"   id="S2_${empSal.eid}"  value="${empSal.basicsalary+empSal.addsal-empSal.addmeritsal}" disabled="disabled" /> </td>
							<td align="center">
						    	<input name="basicsalary"  size="50" />
							</td>
						</tr>
					</c:forEach>
					<tr align="left" bgcolor="#ebf0f7">
						<td colspan="10">
						     <input type="button" value="保存"  />
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
		  <td align="center"><span id="msg" style="color: red">${msg}</span></td>
		</tr>
	</table>
 
 
	
</body>
</html>